Skip to content

fix(elixir): make mix test self-contained + repair KRaft membership semantics#125

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/peaceful-clarke-h3i92h
Jun 11, 2026
Merged

fix(elixir): make mix test self-contained + repair KRaft membership semantics#125
hyperpolymath merged 1 commit into
mainfrom
claude/peaceful-clarke-h3i92h

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Repairs the Elixir suite that has kept elixir-ci red on main since 2026-06-01 (90/634 failures), surfaced when #122 touched the workflow file and re-triggered the path-filtered jobs.

Root causes fixed:

  • test_helper.exs never excluded :integration → 80 federation-adapter integration tests (which require live MongoDB/Redis/Neo4j/ClickHouse/SurrealDB/InfluxDB/MinIO) ran and failed in CI. ExUnit now starts with exclude: [:integration], matching the documented convention (mix test --include integration runs them against the test-infra stack).
  • vql_e2e_test.exs: all 8 failures were one missing alias (VQLBridge absent from the alias braces → bare-module UndefinedFunctionError). These tests are designed to pass without the Rust core, so they stay in the unit suite.
  • kraft_supervisor_test.exs: stale assertion — Registry.child_spec/1 uses the :name option as the child id.
  • kraft_node.ex, two real consensus fixes:
    1. Latest-config-in-log rule (Ongaro §4.1): quorum counting and replication targets now use effective_peers/1 (applied peers + unapplied membership deltas in the log suffix). Previously remove_server deadlocked against the old configuration when a peer was unresponsive, and stale peers' match_index leaked into quorum counting.
    2. Exit-safe peer RPCs: rescue doesn't catch :exit — calls to dead/unregistered peers crashed the RPC tasks. Now treated as failed RPCs (heartbeat/election timer retries), the correct Raft posture.
  • kraft_node_test.exs: membership tests spawn a real follower instead of a phantom peer (under the faithful rule, a server that never responds correctly cannot be added), with leadership polling instead of fixed sleeps.
  • Coverage job: adapters (integration-only) skipped from the unit-coverage denominator; job renamed — its old name claimed a ≥60% gate while the config gate is 40%.

Verification: all touched files parse-checked and mix format --check-formatted passes locally; full compile + suite runs in CI (this environment's network policy blocks repo.hex.pm, so mix deps.get can't run here — stated plainly rather than simulated).

https://claude.ai/code/session_01E8BpV19yxhf67UrCrvkfTr


Generated by Claude Code

…emantics

elixir-ci has been red on main since 2026-06-01 (90/634 failures). Root
causes and fixes:

- test_helper.exs never excluded :integration, so 80 federation-adapter
  integration tests (live MongoDB/Redis/Neo4j/ClickHouse/SurrealDB/
  InfluxDB/MinIO required) ran — and failed — in CI. ExUnit now starts
  with exclude: [:integration]; run them via mix test --include
  integration (the convention CLAUDE.md already documents).
- vql_e2e_test.exs: 8 failures from one missing alias — VQLBridge was
  absent from the alias list, so 8 call sites hit a nonexistent bare
  module. (These tests are designed to pass without the Rust core; they
  are unit tests, not integration.)
- kraft_supervisor_test.exs: stale assertion — Registry.child_spec/1
  uses the :name option as child id (VeriSim.Consensus.Registry), not
  Registry.
- kraft_node.ex: two real consensus fixes.
  (1) Latest-config-in-log rule (Ongaro §4.1): quorum counting and
      replication targets now use effective_peers/1 — the applied peer
      set plus unapplied membership deltas in the log suffix. Previously
      remove_server could never commit in a 2-node cluster with an
      unresponsive peer (proposal counted against the old config) and
      timed out; stale peers' match_index also leaked into quorum
      counting via Map.values.
  (2) Peer RPC tasks caught exceptions but not exits: GenServer.call to
      a dead/unregistered peer exits (:noproc), crashing the task. Both
      RPC tasks now treat that as a failed RPC (heartbeat/election timer
      drives the retry), which is the correct Raft posture.
- kraft_node_test.exs: membership tests now spawn a real follower
  process instead of a phantom peer name — under the faithful rule the
  add entry itself commits against the NEW configuration, so a server
  that never responds correctly cannot be added. Added wait_for_leader/2
  polling instead of fixed sleeps for leadership.
- coveralls.json: skip lib/verisim/federation/adapters/ from the unit
  coverage denominator (they are exercised by the excluded :integration
  suite); CI job renamed to match reality (the old name claimed a 60%
  gate; the config gate is 40%).

Verification here: all touched files parse (Code.string_to_quoted!) and
mix format --check-formatted passes. Full compile + suite verification
happens in CI — the network policy of this environment blocks
repo.hex.pm, so mix deps.get cannot run locally (documented constraint).

https://claude.ai/code/session_01E8BpV19yxhf67UrCrvkfTr
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 177 issues detected

Severity Count
🔴 Critical 17
🟠 High 50
🟡 Medium 110

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in build-validation.yml",
    "type": "missing_timeout_minutes",
    "file": "build-validation.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in build-validation.yml",
    "type": "missing_timeout_minutes",
    "file": "build-validation.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cflite_batch.yml",
    "type": "missing_timeout_minutes",
    "file": "cflite_batch.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cflite_pr.yml",
    "type": "missing_timeout_minutes",
    "file": "cflite_pr.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in coq-build.yml",
    "type": "missing_timeout_minutes",
    "file": "coq-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in elixir-ci.yml",
    "type": "missing_timeout_minutes",
    "file": "elixir-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in elixir-ci.yml",
    "type": "missing_timeout_minutes",
    "file": "elixir-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in elixir-ci.yml",
    "type": "missing_timeout_minutes",
    "file": "elixir-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review June 11, 2026 22:59
@hyperpolymath
hyperpolymath merged commit df0e1b1 into main Jun 11, 2026
37 of 39 checks passed
@hyperpolymath
hyperpolymath deleted the claude/peaceful-clarke-h3i92h branch June 11, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants